{extend name="public/layer_base"}
{block name="main"}
    <div class="layui-body layui-tab-content site-demo site-demo-body">
        <div class="layui-tab-item layui-show">
            <div class="layui-main">
                <div id="LAY_preview">
                    <form class="layui-form" action="{:url('save_category')}" id="send_form">
                        <div class="layui-form-item">
                            <label class="layui-form-label">分类名称</label>
                            <div class="layui-input-block">
                                <input type="text" name="name" lay-verify="required" autocomplete="off" placeholder="请输入标题" class="layui-input" value="{$data.name|default=''}">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-inline">
                                <label class="layui-form-label">上级分类</label>
                                <div class="layui-input-inline">
                                    <select name="pid" lay-verify="required" lay-search="">
                                        <option value="">直接选择或搜索选择</option>
                                        <option value="0"{eq name="data.pid|default=0" value="0"}selected{/eq}>顶级分类</option>
                                        {volist name="category" id="vo"}
                                        <option value="{$vo.id}" {eq name="data.pid|default=0" value="$vo.id"} selected {/eq}>{$vo.level|str_repeat=' -- ', ###}{$vo.name}</option>
                                        {/volist}
                                    </select>
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <input type="hidden" name="id" value="{$data.id|default=0}">
                                <button class="layui-btn" lay-submit="" lay-filter="send_form">立即提交</button>
                                <!--<button class="layui-btn" type="submit">立即提交</button>-->
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
{/block}

{block name="javascript"}
{/block}